package com.ruoyi.mobile.project.pms.controller;

import com.ruoyi.db.pms.domain.PmsIssue;
import com.ruoyi.mobile.project.pms.service.WxPmsIssueService;
import com.ruoyi.mobile.utils.ResponseUtil;
import com.ruoyi.mobile.validator.Order;
import com.ruoyi.mobile.validator.Sort;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/wx/issue")
@Validated
public class WxIssueController
{
    private final Log logger = LogFactory.getLog(WxIssueController.class);

    @Autowired
    private WxPmsIssueService issueService;

    /**
     * 帮助中心
     */
    @RequestMapping("/list")
    public Object list(String question, @RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "10") Integer size, @Sort @RequestParam(defaultValue = "add_time") String sort, @Order @RequestParam(defaultValue = "desc") String order)
    {
        List<PmsIssue> issueList = issueService.querySelective(question, page, size, sort, order);
        return ResponseUtil.okList(issueList);
    }

}
